package com.zqx.decorator.client;

import com.zqx.decorator.abcomponent.Components;
import com.zqx.decorator.specificcomponent.Windows;
import com.zqx.decorator.specificdecorator.BlackBorderDecorator;
import com.zqx.decorator.specificdecorator.ScrollBarDecorator;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Client {

    public static void main(String[] args) {
        Components windows = new Windows();//创建具体构件对象
        Components decorator = new ScrollBarDecorator(windows);//创建装饰后的构件对象
        decorator.display();
        log.info("=============================================================================================");
        Components blackDecorator = new BlackBorderDecorator(decorator);//将装饰了第一次的对象注入另一个装饰类中，进行第二次装饰
        blackDecorator.display();
    }
}
